import Vue from 'vue'
import Router from 'vue-router'
import Home from './views/Home.vue'
import 'element-ui/lib/theme-chalk/index.css'
Vue.use(Router)

export default new Router({
  mode: 'history',
  base: process.env.BASE_URL,
  routes: [
    {
      path: '/',
      name: 'home',
      component: Home
    },
    {
      path: '/login',
      name: 'login',
      // route level code-splitting
      // this generates a separate chunk (about.[hash].js) for this route
      // which is lazy-loaded when the route is visited.
      component: () => import(/* webpackChunkName: "about" */ './views/Login.vue'),
      redirect: '/login/enter',
      children: [
        { path: 'enter', component: () => import('@/components/LoginEnter.vue') },
        { path: 'register', component: () => import('@/components/LoginRegister.vue') },
        { path: 'forgetpassword', component: () => import('@/components/LoginForgetPassword.vue') }
      ]
    },
    // 购物车路由
    {
      path: '/shopcart',
      name: 'shopcart',
      component: () => import('@/components/ShopCart.vue')
    },
    // 搜索路由
    {
      path: '/shopsearch',
      name: 'shopsearch',
      component: () => import('@/components/ShopSearch.vue')
    },
    //搜索商品详情
    {
    path: '/productdetail',
    name: 'productdetail',
    component: () => import('@/components/ProductDetail.vue')
    },
    //搜索商品列表
     {
       path: '/productlist',
       name: 'productlist',
       component: () => import('@/components/ProductList.vue')
     },
    //搜索个人中心
    {
      path: '/Personal',
      name: 'Personal',
      component: () => import('@/components/Personal.vue')
    },
    //搜索订单详情
    {
      path: '/orderinformation',
      name: 'OrderInformation',
      component: () => import('@/components/OrderInformation.vue')
    },
    //搜索填写订单
    {
      path: '/productaddress',
      name: 'productaddress',
      component: () => import('@/components/ProductAddress.vue')
    },
    //搜索邮寄的方式
    {
      path: '/productpost',
      name: 'productpost',
      component: () => import('@/components/ProductPost.vue')
    },
    //搜索付款方式
     {
       path: '/productpayment',
      name: 'productpayment',
      component: () => import('@/components/ProductPayment.vue')
     },

    //搜索付款成功
      {
      path: '/productsuccessful',
      name: 'productsuccessful',
       component: () => import('@/components/ProductSuccessful.vue')
      },
      //搜索优惠码样式
      {
        path: '/productstyle',
        name: 'productstyle',
        component: () => import('@/components/ProductStyle.vue')
      }
  ]
})
